-- 5. The Prelude function concat concatenates a list of lists into a single list and has the
-- following type:
-- -- file: ch04/ch04.exercises.hs
-- concat :: [[a]] -> [a]
-- 6. Write your own definition of concat using foldr.

concat_foldr :: [[a]] -> [a]
concat_foldr xs = foldr step [] xs
  where step x ys = x ++ ys

-- 测试数据
-- concat_foldr ["abc", "123"]
